<div id="content">
	<div class="row s_page_title">
		<sa-big-breadcrumbs [items]="['数据统计','Api统计']" icon="fa fa-area-chart" class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
	</div>
	<sa-widgets-grid>
		<div class="s_table">
			<div sa-widget [editbutton]="false" color="darken" class="clearfix">
				<header><span class="widget-icon"> <i class="fa fa-table"></i> </span><h2>Api统计</h2></header>
				<div>
					<div class="widget-body no-padding">
						<div class="page-header clearfix s_table_opreation">
							<div class="left page-header-btn">
								<div class="top_module">
									<span class="module_text">用户名称</span>
									<div class="s_hover_box">
										<select   class="select2"  id="userNameSelect2">
											<option value=''></option>
										</select>
										<div class="s_del_icon" (click)='delUserName()'>x</div>
									</div>
								</div>
								<div class="top_module">
									<span class="module_text">接口名称</span>
									<div class="s_hover_box">
										<select   class="select2"  id="apiNameSelect2">
											<option value=''></option>
										</select>
										<div class="s_del_icon" (click)='delApiName()'>x</div>
									</div>
								</div>
								<div class="top_module" style="border-radius: 4px;overflow: hidden;border: 1px solid #ccc;">
									<span class="module_text" style="border-radius: 0;height: 26px;line-height: 26px;">时间类型</span>
									<select name="" [(ngModel)]='timeType' class="" (change)="timeTypeChange($event.target.value)" style="display: inline-block;width: 180px;height: 26px;border: none;font-size: 12px;line-height: 26px;padding: 0 12px;vertical-align: top;">
										<option value="0">按小时统计</option>
										<option value="1">按天统计</option>
									</select>
								</div>
								<div class="selectDate top_module">
									<div class="input-daterange input-group s_selected_time_box s_hover_box">
										<input type="text" [(ngModel)]='startTime' class="form-control s_selected_time" id="datetimepicker1" placeholder="请选择开始时间"/>
										<span class="s_selected_time_spe">至</span>
										<input type="text" [(ngModel)]='endTime' class="form-control s_selected_time" id="datetimepicker2" placeholder="请选择结束时间"/>
										<div class="s_del_icon" (click)='del_date()'>x</div>
									</div>
								</div>
								<button type="button" class="btn btn-primary" (click)="search_data()">查询</button>
							</div>
						</div>
						<div class="table_scroll">
							<table class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
								<thead>
									<tr>
										<th *ngIf="isShow">用户名</th>
										<th>接口名称</th>
										<th>调用次数</th>
										<th>开始时间</th>
										<th>结束时间</th>
									</tr>
								</thead>
								<tbody>
									<tr *ngFor="let row of resultTableData" >
										<td *ngIf="isShow">{{row.userName}}</td>
										<td>{{row.apiName}}</td>
										<td>{{row.count}}</td>
										<td>{{row.startTime}}</td>
										<td>{{row.endTime}}</td>
									</tr>
								</tbody>
							</table>
						</div>
						<div class="table-fix clearfix">
							<paginator [totalRecords]="totalCount"
						           [rows]="pageSize"
						           [currentPage]="curPage - 1"
						           (onPageChange)="paginate($event)">
							</paginator>
							<button type="button" class="btn default refresh_btn" (click)="refresh()"><i class="fa fa-refresh"></i></button>
						</div>
					</div>
				</div>
			</div>
		</div>
	</sa-widgets-grid>
</div>